package com.xinyue.network.message.autoconfig;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import com.xinyue.network.message.handler.GameMessageContext;

@Configuration
@ComponentScan("com.xinyue.network.message.web")
public class GameNetworkMessageAutoConfiguration {

    private Logger logger = LoggerFactory.getLogger(GameNetworkMessageAutoConfiguration.class);
    @Autowired
    private ApplicationContext applicationContext;
    
    @Bean
    public GameMessageContext gameMessageContext() {
        logger.debug("开始初始化GameNetworkMessage");
        GameMessageContext gameMessageContext = new GameMessageContext();
        gameMessageContext.init(applicationContext);
        return gameMessageContext;
    }
}
